// Sumber Data : Tabel TERIMABARANG,TERIMABARANGDET,DO,DODETAIL
// Filter	   : Range TglMulai,TglSampai (TANGGAL_LPB,TANGGAL_DO)
// Group By    : KODE_BARANG,NAMA_BARANG,SATUAN
// Field yg ditampilkan : TglMulai,TglSampai,KODE_BARANG,NAMA_BARANG,SATUAN,NAMA_CUSTOMER,QUANTITY
// Query 	   :

// SELECT ITEM_ID,NAMA,UNIT,CUSTOMER,PEMBELIAN,PENJUALAN FROM
// (
// SELECT MIN(TGLMULAI),MAX(TGLSAMPAI),A.KODE_BARANG AS ITEM_ID,A.NAMA_BARANG AS NAMA,A.SATUAN AS UNIT,MAX(B.NAMA_SUPPLIER) AS CUSTOMER,
// SUM(A.QUANTITY) AS PEMBELIAN,'0' as PENJUALAN 
// FROM TERIMABARANGDET A INNER JOIN TERIMABARANG B ON A.NOMOR_LPB = B.NOMOR_LPB
// WHERE A.TANGGAL_LPB BETWEEN '01-01-2014' AND '27-02-1978'
// GROUP BY A.KODE_BARANG,A.NAMA_BARANG

// UNION

// SELECT MIN(TGLMULAI),MAX(TGLSAMPAI),A.KODE_BARANG AS ITEM_ID,A.NAMA_BARANG AS NAMA,A.SATUAN AS UNIT,MAX(B.NAMA_CUSTOMER)AS CUSTOMER,
// '0' as PEMBELIAN, SUM(A.QUANTITY) AS PENJUALAN
// FROM DODETAIL A INNER JOIN DO B ON A.NOMOR_DO = B.NOMOR_DO
// WHERE A.TANGGAL_LPB BETWEEN '01-01-2014' AND '27-02-1978'
// GROUP BY A.KODE_BARANG,A.NAMA_BARANG
// )

Ext.define('SKJF.model.m_rptsales', {
	extend: 'Ext.data.Model',
	alias		: 'widget.m_rptsalesModel',
	fields		: ['NOMOR_LPB','TANGGAL_LPB','NAMA_SUPPLIER','NOMOR_FAKTUR','SUB_TOTAL','TOTAL']	
});